package com.cw.jeeyt.dao.impl.process;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.cw.jeeyt.common.Order;
import com.cw.jeeyt.dao.intf.process.ActDeModelHistoryDao;
import com.cw.jeeyt.dao.mapper.process.ActDeModelHistoryMapper;
import com.cw.jeeyt.dao.model.process.ActDeModelHistoryDo;
import com.cw.lang.common.utils.PageUtil;
import com.cw.lang.common.pagehelper.PageHelper;
import com.cw.lang.mybatis.dto.PageInfo;

/**
 * 流程定义历史 dao数据库操作接口
 *
 * @author chenw
 * @date 2019-03-10 21:47:04
 */
@Repository
public class ActDeModelHistoryDaoImpl implements ActDeModelHistoryDao {
    @Autowired
    private ActDeModelHistoryMapper actDeModelHistoryMapper;

    /**
     * 新增流程定义历史
     *
     * @param actDeModelHistory
     * @return 整数
     */
    public Integer insert(ActDeModelHistoryDo actDeModelHistory) {
        return actDeModelHistoryMapper.insert(actDeModelHistory);
    }

    /**
     * 新增流程定义历史不为空的字段
     *
     * @param actDeModelHistory
     * @return 整数
     */
    public Integer insertSelective(ActDeModelHistoryDo actDeModelHistory) {
        return actDeModelHistoryMapper.insertSelective(actDeModelHistory);
    }

    /**
     * 删除流程定义历史
     *
     * @param actDeModelHistory
     */
    public void delete(ActDeModelHistoryDo actDeModelHistory) {
        actDeModelHistoryMapper.delete(actDeModelHistory);
    }

    /**
     * 修改流程定义历史不为null的字段
     *
     * @param actDeModelHistory
     */
    public void updateSelective(ActDeModelHistoryDo actDeModelHistory) {
        actDeModelHistoryMapper.updateSelective(actDeModelHistory);
    }

    /**
     * 修改流程定义历史
     *
     * @param actDeModelHistory
     */
    public void update(ActDeModelHistoryDo actDeModelHistory) {
        actDeModelHistoryMapper.update(actDeModelHistory);
    }

    /**
     * 根据主键查询流程定义历史
     *
     * @return 流程定义历史
     */
    public ActDeModelHistoryDo getById(String id) {
        return actDeModelHistoryMapper.getById(id);
    }

    /**
     * 查询所有流程定义历史
     *
     * @return 流程定义历史集合
     */
    public List<ActDeModelHistoryDo> queryActDeModelHistoryList() {
        return actDeModelHistoryMapper.queryActDeModelHistoryList();
    }

    /**
     * 分页查询流程定义历史
     *
     * @param actDeModelHistory 查询条件
     * @param startNum 开始条数
     * @param pageSize 每页长度
     * @return 流程定义历史集合
     */
    public PageInfo<ActDeModelHistoryDo> queryByPage(ActDeModelHistoryDo actDeModelHistory, Integer startNum,
        Integer pageSize, Order order) {
        PageHelper.startPage(PageUtil.calPageNum(startNum, pageSize), pageSize);
        return new PageInfo<>(actDeModelHistoryMapper.queryByPage(actDeModelHistory, order));
    }
}
